pp108 : Creating Assignments

Creating Assignments

This task describes the procedure to create assignments for various elements used in a Business Process Model (BPM) and a Case model.

Message data is based on the XML Schema of the associated document. As data is passed between the activities, you may need to transform the data between these source and target activities to ensure a smooth flow of data. Assignments or message maps enable data transformation and message flow from one activity to another. Message mapping between the activities is performed for the business processes and Case models.

  1. Select a starting point and click to open a Case model. Alternatively, select a starting point and click to open a BPM. The Case model appears in the modeling environment.

    Note:
    If you click , the BPM appears in the modeling environment.

  2. Select an activity for which you want to assign the input data and click the Message Map tab. The Message Map window appears displaying the two tabs - Pre Assignments and Post Assignments.

    Note:

    • The Start Event has only the post-activity assignment and the End Event has only the pre-activity assignment. Therefore, the Pre Assignments and Post Assignments tabs do not appear for the Start Event and End Event activities. This is also applicable to Exception, Timeout, Compensate, and Decision constructs.
    • You cannot map the output messages of a Human Task in a Case model.
    • In a Case model, you can now map the previous activity details as part of the Pre-Assignments of an Activity. This option is available for the activities that are connected through Automatic, Manual, or Intermediate followup modes and if both the previous and current activities are in the same state. However, even though previous activity details are displayed in the Pre-Assignments of the first activity in the state, you cannot pass values to the activities during runtime. Also, you cannot map previous activity details for a Free followup activity.
  3. Do one of the following to assign the input data:
    • Drag a source element from the Source column on the left and drop it on the left text box of the Assignments column. Drag a target element from the Target column on the right and drop it on the right text box of the Assignments column.
    • Select the source element, hold down the Control key on the keyboard, and select the target element. A new map appears in the Assignments column displaying the new assignment.

      Note:
      You can drag multiple source elements onto the Assignments column for a single target element in an assignment.

  4. Select the operation type from the Use drop-down list and then select the required operation from the respective operation sub menu in the Assignments column. For example, to select the operation Replace Content with Expression, you must click the Use drop-down list, select Replace Content With first and then Expression from the sub navigation menu. The operation is set for the assignment.
  5. Provide a value in the input area provided under the dropped elements for the Fixed Value or Expression assignment in the Assignments column. For example, to retrieve the employee records of the first employee, you must specify a fixed value of 1 as an input for Employee ID. This requires a fixed value assignment for the Employee ID element. You can achieve this by doing any of the following:
    • Click the Use drop-down list, select Replace Content With first and then Fixed Value from the sub navigation menu.
    • Drag the Fixed Value icon on the bottom left corner to the map area in the Assignments column.

The assignments are created for the required elements.

  • When you make the assignments in a BPM, for string constants, provide values in double quotes and for others such as conditions, functions, and expressions, provide the values in single quotes. For example, consider the following assignment: add the expression test.
  • The Message data (XML Schema) of the associated activities are generated based on the document name. If there is a change in the associated document name, then the assignments defined will be invalid. Therefore, you must update the assignments according to the modified message data.
  • While creating assignments in the BPM, the attachment definitions defined in the sub-process are also available through the message-map. While performing mappings of such attachment definitions, ensure the following:
    • The operation must be set as Replace Content With and the parameter must be Children with Target NS.
    • The MIME types for the attachment definitions that are being considered for the message-mappings are compatible. This ensures that during the execution of a process instance, when the attachment details are shared, the process instance aligns with the MIME type that is already defined for the subprocess.
  • The changes made to the message-map through assignments are done in-memory and are persisted at the subsequent recovery point. In case of a crash before the persistence of the changes in the message-map, during crash recovery, when the process instance starts execution from the last saved recovery point, there may be repetition of assignments. This must not cause any issue with assignments using regular XPath expressions or fixed value as a source. However, if the source XPath triggers a custom Java API with certain actions in the Java code, the actions may be executed again. Such scenarios must be handled during the application development.
  • If a subcase is associated with another Case model, assignments can be provided to both the Case data and Case variables of the subcase. The tooltip of the Case variable represents its type. The option to pass values to the Case variable is available when a subcase is used in both the Case and BPM models. The Case variables of the Case model can be passed to the Case variables of its subcase.
    • From BOP 4.3, you can also update the Case Variables through the message map. It is no longer required to trigger the UpdateCaseVariables API to have the related changes or updates considered explicitly as a part of the Case model execution.

 

Related concepts

Pre Assignments
Post Assignments
Process Specific Messages